/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.route.system.session;

import com.route.system.entity.RpsRouteTimeSchedule;
import java.util.List;
import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import javax.persistence.Query;

/**
 *
 * @author neco
 */
@Stateless
public class RpsRouteTimeScheduleFacade extends AbstractFacade<RpsRouteTimeSchedule> {
    @PersistenceContext(unitName = persistenceUnitName)
    private EntityManager em;

    @Override
    protected EntityManager getEntityManager() {
        return em;
    }

    public RpsRouteTimeScheduleFacade() {
        super(RpsRouteTimeSchedule.class);
    }
    
    public List<RpsRouteTimeSchedule> findByScheduleWeekDayAndScheduleDesc(Integer RouteDescId,Integer scheduleWeekDay) {
        Query query = getEntityManager().createNamedQuery("RpsRouteTimeSchedule.findByScheduleWeekDayAndScheduleDesc", RpsRouteTimeSchedule.class);
        query.setParameter("scheduleWeekDay", scheduleWeekDay);
        query.setParameter("descriptionId", RouteDescId);
        return query.getResultList();
    }
    
}
